﻿using System;

namespace SCG.General
{
    public class SCGRect
    {
        public SCGRect()
        {
        }
        public SCGRect(int x, int y, int width, int height)
        {
            X = x;
            Y = y;
            Width = width;
            Height = height;
        }

        public int X { get; set; }
        public int Y { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }

        public bool Contains(SCGPoint pt)
        {
            return pt.X >= X && pt.Y >= Y && pt.X < X + Width && pt.Y < Y + Height;
        }

        public int Right
        {
            get
            {
                return X + Width - 1;
            }
        }

        public int Bottom
        {
            get
            {
                return Y + Height - 1;
            }
        }
    }
}
